FLAG    = -fopenmp
MPICC   = mpicc
CC      = gcc
CD      = cd
RM      = /bin/rm -rf

BIN     = ../bin
TEST    = ../test
OMP_PATH = openmp
MPI_PATH = openmpi

T_OMP_TREE = test_tree.c
T_OMP_TREE_SRC = $(TEST)/$(OMP_PATH)/$(T_OMP_TREE)
T_OMP_TREE_OUT = test_tree.o

T_OMP_TOUR = test_tour.c
T_OMP_TOUR_SRC = $(TEST)/$(OMP_PATH)/$(T_OMP_TOUR)
T_OMP_TOUR_OUT = test_tour.o

T_OMP_ORI = test_omp.c
T_OMP_ORI_SRC = $(TEST)/$(OMP_PATH)/$(T_OMP_ORI)
T_OMP_ORI_OUT = test_omp.o

T_OMP_TREE_OPT1 = test_tree_opt1.c
T_OMP_TREE_OPT1_SRC = $(TEST)/$(OMP_PATH)/$(T_OMP_TREE_OPT1)
T_OMP_TREE_OPT1_OUT = test_tree_opt1.o

T_OMP_TREE_OPT2 = test_tree_opt2.c
T_OMP_TREE_OPT2_SRC = $(TEST)/$(OMP_PATH)/$(T_OMP_TREE_OPT2)
T_OMP_TREE_OPT2_OUT = test_tree_opt2.o

T_OMP_TREE_OPT3 = test_tree_opt3.c
T_OMP_TREE_OPT3_SRC = $(TEST)/$(OMP_PATH)/$(T_OMP_TREE_OPT3)
T_OMP_TREE_OPT3_OUT = test_tree_opt3.o

T_MPI_TREE = test_tree.c
T_MPI_TREE_SRC = $(TEST)/$(MPI_PATH)/$(T_MPI_TREE)
T_MPI_TREE_OUT = mpi_test_tree.o

T_MPI_TOUR = test_tour.c
T_MPI_TOUR_SRC = $(TEST)/$(MPI_PATH)/$(T_MPI_TOUR)
T_MPI_TOUR_OUT = mpi_test_tour.o

T_MPI_ORI = test_mpi.c
T_MPI_ORI_SRC = $(TEST)/$(MPI_PATH)/$(T_MPI_ORI)
T_MPI_ORI_OUT = test_mpi.o

T_COMBINE = test_combine.c
T_COMBINE_SRC = $(TEST)/$(T_COMBINE)
T_COMBINE_OUT = test_combine.o

T_COMBINE_2 = test_combine_2.c
T_COMBINE_2_SRC = $(TEST)/$(T_COMBINE_2)
T_COMBINE_2_OUT = test_combine_2.o

T_COMBINE_3 = test_combine_3.c
T_COMBINE_3_SRC = $(TEST)/$(T_COMBINE_3)
T_COMBINE_3_OUT = test_combine_3.o

T_COMBINE_4 = test_combine_4.c
T_COMBINE_4_SRC = $(TEST)/$(T_COMBINE_4)
T_COMBINE_4_OUT = test_combine_4.o

clean:
	$(RM) $(BIN)/*.o

testomptree:
	$(CC) $(FLAG) $(T_OMP_TREE_SRC) -o $(BIN)/$(T_OMP_TREE_OUT)

testomptour:
	$(CC) $(FLAG) $(T_OMP_TOUR_SRC) -o $(BIN)/$(T_OMP_TOUR_OUT)

testompbarrier:
	$(CC) $(FLAG) $(T_OMP_ORI_SRC) -o $(BIN)/$(T_OMP_ORI_OUT)

testomptreeopt1:
	$(CC) $(FLAG) $(T_OMP_TREE_OPT1_SRC) -o $(BIN)/$(T_OMP_TREE_OPT1_OUT)

testomptreeopt2:
	$(CC) $(FLAG) $(T_OMP_TREE_OPT2_SRC) -o $(BIN)/$(T_OMP_TREE_OPT2_OUT)

testomptreeopt3:
	$(CC) $(FLAG) $(T_OMP_TREE_OPT3_SRC) -o $(BIN)/$(T_OMP_TREE_OPT3_OUT)

testmpitree:
	$(MPICC) $(T_MPI_TREE_SRC) -o $(BIN)/$(T_MPI_TREE_OUT)

testmpitour:
	$(MPICC) $(T_MPI_TOUR_SRC) -o $(BIN)/$(T_MPI_TOUR_OUT)

testmpibarrier:
	$(MPICC) $(T_MPI_ORI_SRC) -o $(BIN)/$(T_MPI_ORI_OUT)

testcombine:
	$(MPICC) $(FLAG) $(T_COMBINE_SRC) -o $(BIN)/$(T_COMBINE_OUT)

testcombine2:
	$(MPICC) $(FLAG) $(T_COMBINE_2_SRC) -o $(BIN)/$(T_COMBINE_2_OUT)

testcombine3:
	$(MPICC) $(FLAG) $(T_COMBINE_3_SRC) -o $(BIN)/$(T_COMBINE_3_OUT)

testcombine4:
	$(MPICC) $(FLAG) $(T_COMBINE_4_SRC) -o $(BIN)/$(T_COMBINE_4_OUT)


